package com.sc.nft.entity.vo.mall;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.sc.nft.enums.IncomeHierarchyEnum;
import com.sc.nft.enums.MallOrderIncomeTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class PageMallPopularizeOrderVO {

    @ApiModelProperty("订单id")
    private Long id;

    @ApiModelProperty("品牌名称")
    private String daoName;

    @ApiModelProperty("订单号")
    private String orderNo;

    @ApiModelProperty("预估收益")
    private String incomeNum;

    @ApiModelProperty("版权收益")
    private String meteMap;

    @ApiModelProperty("下单时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("WAITING_ACCOUNT:待到账 HAS_ARRIVED :已到账 EXPIRED :已失效")
    private MallOrderIncomeTypeEnum incomeStatus;

    @ApiModelProperty("收益层级")
    private IncomeHierarchyEnum incomeHierarchy;

    @ApiModelProperty("失效的收益")
    private String cancelIncomePrice;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("商品列表")
    private List<MallOrderProductDetailsVO> productList = Lists.newArrayList();

    @ApiModelProperty("省")
    private String province;

    @ApiModelProperty("市")
    private String city;

    @ApiModelProperty("区")
    private String area;

    public void setIncomeNum(BigDecimal incomeNum) {
        this.incomeNum = incomeNum.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

    public void setCancelIncomePrice(BigDecimal cancelIncomePrice) {
        this.cancelIncomePrice = cancelIncomePrice.setScale(2, BigDecimal.ROUND_DOWN).toPlainString();
    }

}
